*****************
**** Table 1 ****
*****************

use "$data/paymentdata_ready" , clear

keep if t==1 

local balancevars preratiow1 premeanpaymentw1 prepaymentsmade premeaninvoicew1 nodebt collectiv visible personalcontactdummy treatedcount 

log using "$output/table 1", replace

** Summary Statistics ** Median is displayed for collection efficiency (less sensitive to outliers)
estpost tabstat `balancevars', by(treatmentall) statistics(mean sd  p50  n) columns(statistics) nototal  

** Test of equality **
foreach v of var `balancevars' {
reg `v' treatmentalldummy*,  vce(cluster dayteam) nocons
test _b[treatmentalldummy1] = _b[treatmentalldummy2] = _b[treatmentalldummy3] = _b[treatmentalldummy4] = _b[treatmentalldummy5] = _b[treatmentalldummy6] = _b[treatmentalldummy7]
}

log close





